<template>
  <div>
    <div>中</div>
    <div>利用公交中线BUS传递给兄弟组件参数</div>
    <div class="search_box">
      <el-select v-model="valueS" placeholder="请选择" @change="choiceValue(valueS)">
        <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
        </el-option>
      </el-select>
    </div>
  </div>
</template>

<script>
import Bus from "@/untils/bus";
export default {
  data() {
    return {
      options: [{
        value: '选项1',
        label: '黄金糕'
      }, {
        value: '选项2',
        label: '双皮奶'
      }, {
        value: '选项3',
        label: '蚵仔煎'
      }, {
        value: '选项4',
        label: '龙须面'
      }, {
        value: '选项5',
        label: '北京烤鸭'
      }],
      valueS: ''
    }
  },
  watch: {},
  activated() { },
  created() { },
  methods: {
    choiceValue(value) {
      console.log('value=====', value);
      let obj = {};
      obj = this.options.find((item) => {
        return item.value === value;
      });
      console.log("--------------", obj)
      Bus.$emit('setListInfo', obj)
    }
  },
  mounted() { }
}
</script>

<style lang='scss'></style>